Print control apparatus, print control method, and storage medium

ABSTRACT

If a print medium size is set as a print setting for print target data, a print control apparatus causes a printing unit to print an image with a size corresponding to the print medium size based on the print target data. If the print medium size is not set as the print setting, the print control apparatus causes the printing unit to print an image with a size corresponding to a candidate print medium size obtained by a sensor detecting the size of the print medium.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of prior U.S. patent application Ser.No. 14/314,986, filed Jun. 25, 2014 which claims the benefit of JapanesePatent Application No. 2013-137041 filed Jun. 28, 2013. U.S. patentapplication Ser. No. 14/314,986 and Japanese Patent Application No.2013-137041 are hereby incorporated by reference herein in theirentirety.

BACKGROUND

1. Field of the Disclosure

Aspects of the present invention generally relate to a print controlapparatus, a print control method, and a storage medium each of whichcauses an image to be printed based on print target data.

2. Description of the Related Art

There are known techniques in which, when a printing apparatus performsprinting, a paper width sensor included in the printing apparatusdetects the width of printing paper for use in printing and the printingapparatus scales a print target image in such a way as to fit the paperwidth detected by the paper width sensor.

As one of techniques to dispense with a user operation for selecting thepaper size, Japanese Patent Application Laid-Open No. 11-155043discusses a technique to detect the width of printing paper via a sensorand to scale print data in such a way as to fit the detected paper widthfor printing.

In the technique discussed in Japanese Patent Application Laid-Open No.11-155043, a print target image is inevitably scaled (enlarged orreduced) based on the paper width information detected by the sensor.Therefore, when printing paper, the size of which is greatly differentfrom the size of printing paper to be used for printing, is set in theprinting apparatus, appropriate printing may not be performed.

For example, in the technique discussed in Japanese Patent ApplicationLaid-Open No. 11-155043, even if the size of printing paper is set bythe user as one of the print settings about the print target data, animage may be scaled according to a result of detection of the paperwidth by the sensor irrespective of the set size of printing paper.Accordingly, when printing paper, the size of which is greatly differentfrom the size of printing paper set as one of the print settings, is setin the printing apparatus, an image with an inappropriate size may beprinted.

SUMMARY

Aspects of the present invention relate to a print control apparatus, aprint control method, and a storage medium each of which is capable ofcausing an image with an appropriate size to be printed.

According to an aspect of the present invention, an apparatus includesan acquisition unit configured to acquire a candidate size of a printmedium, the candidate size being obtained by a sensor detecting the sizeof the print medium, a determination unit configured to determinewhether a print medium size is set as a print setting for print targetdata, and a print control unit configured to, if the determination unitdetermines that the print medium size is set as the print setting, causea printing unit to print an image with a size corresponding to the printmedium size based on the print target data, and, if the determinationunit does not determine that the print medium size is set as the printsetting, cause the printing unit to print an image with a sizecorresponding to the candidate size acquired by the acquisition unitbased on the print target data.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic sectional view illustrating a printing mechanismincluded in a printing apparatus according to an exemplary embodiment.

FIG. 2 is a schematic diagram illustrating a manner in which a papersensor detects the width of paper (paper width).

FIG. 3 is a block diagram illustrating a configuration of the printingapparatus.

FIGS. 4A and 4B illustrate paper size tables according to the exemplaryembodiment.

FIG. 5 is a flowchart illustrating an example of print controlprocessing performed by a central processing unit (CPU).

FIGS. 6A and 6B are flowcharts illustrating the details of a fittingprocess.

FIGS. 7A, 7B, 7C, 7D, 7E, and 7F illustrate various relationshipsbetween the size of a layout region and the size of printing paper whenprinting is performed according to the process illustrated in FIG. 6A or6B.

FIG. 8 is a flowchart illustrating an example of print controlprocessing for a copy function.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

FIG. 1 is a schematic sectional view illustrating a printing mechanismincluded in a printing apparatus 100 according to an exemplaryembodiment. Printing paper 102 is stored in a paper feed tray 101. Apaper feed roller 103 feeds printing paper stored in the paper feed tray101 to conveyance rollers 105 and 106. Printing paper 104 is a sheetthat has been fed by the paper feed roller 103 and is being transportedby the conveyance rollers 105 and 106. As illustrated in FIG. 1, theprinting paper 104 is conveyed by the conveyance rollers 105 and 106 toconveyance rollers 109 and 110 via a conveyance path, which is formed bymembers 107 and 108. The conveyance rollers 109 and 110 convey theprinting paper 104 to a platen 111.

A carriage 113, to which a print head 112 is mounted, is arranged abovethe platen 111. The carriage 113 reciprocates in the direction A (fromthe near side to the far side in FIG. 1) and the direction B (from thefar side to the near side in FIG. 1) illustrated in FIG. 1 along a guiderail 114. The printing apparatus 100 applies drive pulses to the printhead 112 to cause the print head 112 to discharge a recording agent,such as ink, onto the printing paper 104, while moving the carriage 113in the direction A and the direction B. With the recording agent beingdischarged from the print head 112 to the recording paper 104, a printtarget image can be printed on the recording paper 104. The recordingpaper 104, on which an image has been printed, is conveyed by theconveyance rollers 109 and 110 to discharge rollers 115 and 116. Thedischarge rollers 115 and 116 discharge the printing paper 104 to adischarge tray 117.

A paper sensor 118, which is a reflection-type optical sensor, ismounted to the carriage 113. The printing apparatus 100 acquires anoutput level (output voltage) indicating the intensity of light receivedby the paper sensor 118 and determines whether the output level is alevel corresponding to reflected light from the printing paper, thusdetecting whether the printing paper is present at a position where thereflected light is received by the paper sensor 118. The paper sensor118 is mounted to the carriage 113 as described above, and is thusmovable together with the print head 112. The printing apparatus 100detects whether the printing paper 104 is present in a range in whichthe paper sensor 118 is moved, and thus determines edge portions of theprinting paper in the range of movement of the paper sensor 118. Then,the printing apparatus 100 detects the width of the printing paper basedon a distance between the right-hand and left-hand edge portions of theprinting paper. The details of processing for detecting the width of theprinting paper are described below with reference to FIG. 2. Themovement position of the paper sensor 118 (the carriage 113) is detectedby an encoder 224, to be described below.

The printing mechanism of the printing apparatus 100 includes the paperfeed tray 101, the platen 111, the print head 112, the carriage 113, theguide rail 114, the discharge tray 117, and the above-mentioned variousrollers.

FIG. 2 is a schematic diagram illustrating a manner in which the papersensor 118 detects the width of paper (paper width).

The printing apparatus 100 prints an image on the printing paper 104, asdescribed above, by causing the print head 112 to discharge a recordingagent while moving the carriage 113 along the guide rail 114 in thedirection A and the direction B. A head recovery mechanism 119, whichperforms capping of the print head 112, is arranged in a positionoutside the platen 111 in the movement range of the carriage 113 (theposition x of the paper sensor 118). The position x of the paper sensor118 can be identified by the position of the carriage 113 detected bythe encoder 224, to be described below.

The paper sensor 118 receives light while moving above the platen 111and detects an output level of the received light. The graph illustratedin FIG. 2 indicates an output level Vs detected by the paper sensor 118in the movement range of the carriage 113. In the present exemplaryembodiment, the printing paper is in a bright color, such as white, andthe platen 111 is in a dark color, such as black. Accordingly, a highoutput level (strong reflected light from the printing paper) can bedetected in a position where the printing paper is present on the platen111, and a low output level (weak reflected light from the printingpaper) can be detected in a position where the printing paper is notpresent on the platen 111.

The paper sensor 118 receives reflected light in a position E on theplaten 111 when the carriage 113 is located in a position above the headrecovery mechanism 119. Then, when the carriage 113 moves in thedirection A, the output level Vs increases in a position correspondingto an edge portion of the printing paper 104. Then, the output level Vsremains almost constant during a period when the carriage 113 moves fromthe edge portion of the printing paper 104 to the opposite edge portionthereof. The output level Vs then decreases in a position correspondingto the opposite edge portion of the printing paper 104.

In the present exemplary embodiment, when the output level Vs of thepaper sensor 118 exceeds a predetermined threshold value Vth, theprinting apparatus 100 determines that the printing paper 104 is presentin a position where the output level Vs has been detected. Morespecifically, the printing apparatus 100 determines the positions G andF in FIG. 2 as the positions of the respective edges of the printingpaper 104, and determines the range from the position G to the positionF as a range in which the printing paper is present. Then, the printingapparatus 100 detects the distance between the position G and theposition F as the paper width of the printing paper 104.

In the present exemplary embodiment, the printing apparatus 100 conveysthe printing paper 104 in a centering manner such that the central lineof the printing paper 104 passes through the middle position C of theplaten 111. At this time, if the printing paper 104 is so large that theright-hand edge of the printing paper 104 is located on the right sideof the position E in FIG. 2, the printing apparatus 100 may not be ableto detect the position of the right-hand edge of the printing paper 104.

Therefore, in the present exemplary embodiment, in a case where theright-hand edge of the printing paper 104 is located on the right sideof the position E, the printing apparatus 100 determines the paper widthof the printing paper 104 based on the distance between the middleposition C and the position G of the left-hand edge of the printingpaper 104. More specifically, if the output level Vs in the position Eexceeds the threshold value Vth, the printing apparatus 100 determinesthat the right-hand edge of the printing paper 104 is located in theposition E or on the right side of the position E. In such a case, theprinting apparatus 100 detects the length obtained by doubling thedistance between the middle position C and the position G as the paperwidth of the printing paper 104. In other words, since the printingapparatus 100 conveys the printing paper 104 in such a manner thecentral line of the printing paper 104 passes through the middleposition C, the distance between the middle position C and the positionG of the left-hand edge of the printing paper 104 corresponds to half ofthe paper width of the printing paper 104. Therefore, the printingapparatus 100 can detect the length obtained by doubling the distancebetween the middle position C and the position G as the paper width.Since a value indicating the middle position C in the movement range ofthe carriage 113 is previously stored in a memory included in theprinting apparatus 100, the printing apparatus 100 can refer to thestored value to obtain the distance between the middle position C andthe position G.

The above-described threshold value Vth is not limited to a fixed value,but may be varied, for example, according to the output level Vs in theposition E. Moreover, the threshold value Vth may be determinedaccording to the intensity of reflected light due to the surfacecharacteristics of a print medium. More specifically, the thresholdvalue Vth may be varied according to the type of paper usable forprinting, such as plain paper and glossy paper. Furthermore, theprinting apparatus 100 may detect the presence or absence of printingpaper based on a result of comparison between the output level Vs in theposition E and the output level Vs in another position, instead ofdetermining whether the output level Vs exceeds the threshold value Vth.For example, in a case where the printing apparatus 100 determines thatthe printing paper is not present in the position E based on the outputlevel Vs in the position E, the printing apparatus 100 may determinethat the printing paper is present in a position where an output levelVs that is larger than the output level Vs in the position E by apredetermined value or more is detected.

In addition, in the example illustrated in FIG. 2, the paper sensor 118,which is mounted to the carriage 113, performs detection while movingtogether with the carriage 113. However, this is not a restrictive one.For example, paper sensors may be mounted on the platen 111 separatelyfrom the carriage 113. In this case, sensors the number of whichcorresponds to the width of a conveyance path for printing paper arealigned and arranged on the platen 111, and each paper sensor detectswhether the printing paper is present, thus enabling detection of thewidth of the printing paper.

Next, a configuration of the printing apparatus 100 is described. FIG. 3is a block diagram illustrating the configuration of the printingapparatus 100.

A CPU 201 is a processor that controls the printing apparatus 100. TheCPU 201 is connected to a program memory 203, such as a read-only memory(ROM) or a hard disk, and a data memory 204, such as a random accessmemory (RAM), via an internal bus 202. The program memory 203 stores aprogram for controlling the printing apparatus 100. The CPU 201 cancontrol the printing apparatus 100 by reading out the program stored inthe program memory 203 to the data memory 204 and executing the programon a work memory 205, which is allocated to the data memory 204. Animage memory 206 is also allocated to the data memory 204. The CPU 206loads, on the image memory 206, various typed of data, including imagedata to be printed by the printing apparatus 100.

An interface control unit 207 communicates with a smart device 208, suchas a smartphone, via an interface under the control of the CPU 201. Forexample, the interface control unit 207 can receive a print target jobfrom the smart device 208 and notify the smart device 208 of statusinformation of the printing apparatus 100. In addition, the interfacecontrol unit 207 may perform communication via a wired interface, suchas a universal serial bus (USB) cable. Also, the interface control unit207 may perform communication via a wireless interface, such as infraredcommunication or a wireless local area network (LAN). The smart device208 is, for example, a smartphone or a tablet, and includes varioustypes of devices, such as mobile phones.

The partner with which the printing apparatus 100 communicates is notlimited to the smart device 208, but may be a personal computer, aserver connected via a network, an apparatus connected via telephonelines, such as a facsimile apparatus, or a digital television set.Furthermore, the present exemplary embodiment not only applies to thecase where print target data is included in a print job, but alsoapplies the case where the printing apparatus 100 acquires print targetdata from an external apparatus, such as a server, based on addressinformation included in the print job.

A motor control unit 209 controls various motors for driving theprinting mechanism of the printing apparatus 100 under the control ofthe CPU 201. A conveyance motor 210 drives the paper feed roller 103,the conveyance rollers 105, 106, 109, and 110, and the discharge rollers115 and 116 under the control of the motor control unit 209. A carriagemotor (CR motor) 211 drives the carriage 113 under the control of themotor control unit 209 to reciprocate the carriage 113. A recovery motor212 drives the head recovery mechanism 119 under the control of themotor control unit 209.

A head control unit 213 controls the print head 112 under the control ofthe CPU 201 to cause the print head 112 to discharge a recording agent,such as ink. The CPU 201 drives both the print head 112 and theconveyance motor 210 to cause the print head 112 to print an image onprinting paper while moving. Thus, the CPU 201 included in the printingapparatus 100 serves as a print control apparatus, which controls theprinting mechanism, including the various motors and the print head 112,to print an image.

A sensor control unit 214 causes, under the control of the CPU 201, asensor light source 215 included in the paper sensor 118 to emit lightand an optical sensor 216 included in the paper sensor 118 to receivereflected light. The sensor control unit 214 acquires an output levelindicating the intensity of light received by the optical sensor 216.The CPU 201 acquires the output level acquired by the sensor controlunit 214 to determine the paper width as illustrated in FIG. 2. Then,the CPU 201 performs processing, to be described below, to determinepaper size, including paper length, based on the determined paper width.

A panel control unit 217 controls an operation panel 218 under thecontrol of the CPU 201. The operation panel 218 includes an operationdevice operable by the user, such as a key bad or touch panel, and adisplay panel capable of displaying various types of information, suchas images. For example, when the user operates the operation device ofthe operation panel 218, an instruction from the user is input to thepanel control unit 217 and is then input to the CPU 201. The panelcontrol unit 217 displays, on the display panel of the operation panel218, an image loaded on the image memory 206 in response to aninstruction from the CPU 201.

A scanner control unit 219 controls a scanner 220 under the control ofthe CPU 201 to cause the scanner 220 to read a document placed on adocument positioning board of the scanner 220, and receives the readimage from the scanner 220. Then, the scanner control unit 219 storesthe received image into the image memory 206. A memory card control unit221 writes and reads various types of data in and from a memory card 223connected to a memory card slot 222.

An encoder 224 is used to identify the position of the carriage 113 whenthe carriage 113 moves along the guide rail 114. The CPU 201 identifiesthe position x of the carriage 113, illustrated in FIG. 2, based on theposition of the carriage 113 identified via the encoder 224 and themounting position of the paper sensor 118 on the carriage 113.

In the present exemplary embodiment, the CPU 201 determines the papersize, including the paper length, based on the paper width determined bythe paper sensor 118 as described above. In the printing apparatus 100according to the present exemplary embodiment, the paper sensor 118 aswell as the print head 112 is mounted to the carriage 113. In addition,various motors for moving the carriage 113, the guide rail 114, andmembers for identifying the position of the carriage 113, such as theencoder 224, are used in common for both printing by the print head 112and detection of the paper width via the paper sensor 118. Therefore, itis not necessary to provide such members for detection of the paperwidth separately for the members for printing, so that the printingapparatus 100 can be prevented from increasing in size.

FIGS. 4A and 4B illustrate paper size tables according to the presentexemplary embodiment. The paper size table illustrated in FIG. 4A listspaper size 300 of printing paper usable in the printing apparatus 100and paper width 301, paper length 302, and aspect ratio(vertical-to-horizontal ratio) 303 of the paper size. The unit of eachof paper width 301 and paper length 302 is millimeter (mm).

The paper size table is stored in the program memory 203. The CPU 201can refer to the paper size table by reading out the paper size tablefrom the program memory 203 to the data memory 204. The presentexemplary embodiment is not limited to a case where information of thepaper width 301 is retained in a table format, but the present exemplaryembodiment can adopt various methods for storing information of thepaper width 301 in association with the paper size.

In the present exemplary embodiment, the CPU 201 determines the size ofprinting paper based on the paper width detected by the paper sensor118. More specifically, the CPU 201 identifies, as the size of printingpaper 104 conveyed in the printing apparatus 100, the paper size 300having the paper width 301 that is within a predetermined rangeincluding the paper width detected by the paper sensor 118 in the papersize table. The reason for providing the predetermined range is that,since the intensity of reflected light from the printing paper variesdepending on the state of the printing paper or the environment wherethe printing apparatus 100 is placed, an error may occur between aresult of detection by the paper sensor 118 and the actual paper width.

Therefore, for example, the predetermined range is set to a range from 3mm above the detected paper width to 3 mm below the detected paperwidth. When “126.0 mm” is detected as the paper width by the papersensor 118, the CPU 201 specifies, as a candidate size of printingpaper, the paper size 300 corresponding to the paper width 301 includedin a range from 123.0 mm to 129.0 mm. In this case, as indicated in thepaper size table illustrated in FIG. 4A, Photo 2L, which corresponds tothe paper width 301 (127.0 mm), is specified as a candidate paper size.

Furthermore, the paper size may not be necessarily uniquely specified,and a plurality of paper sizes that is similar in paper width may bespecified as candidate sizes of the print medium. For example, when“99.0 mm” is detected as the paper width by the paper sensor 118,Envelope You #6 (paper width: 98.0 mm), Postcard (paper width: 100.0mm), and Photo 4×6 (paper width: 101.6 mm) are included in a paper widthrange from 96.0 mm to 102.0 mm. Similarly, when “213.0 mm” is detectedas the paper width, A4 size (paper width: 210.0 mm) and Letter (paperwidth: 215.9 mm) are specified as candidate paper sizes.

In the present exemplary embodiment, in a case where the size ofprinting paper is set as one of print settings, the CPU 201 determineswhether the size of printing paper specified by the user is included inone or more candidate paper sizes specified via the paper sensor 118.Then, if the size of printing paper specified by the user is included inone or more candidate paper sizes, the CPU 201 causes an image with asize corresponding to the specified size to be printed on the printingpaper.

If the size of printing paper specified by the user is not included inany candidate paper sizes, the CPU 201 causes an image with a sizecorresponding to a candidate paper size to be printed on the printingpaper or restricts printing.

Accordingly, for example, if the user erroneously specifies a size thatis greatly different from the size of printing paper used for printing,or if printing paper with a size that is greatly different from the sizespecified by the user is conveyed, the printing apparatus 100 canperform appropriate print processing. More specifically, in such a case,the printing apparatus 100 can prevent an image with a size that isgreatly different from the size of printing paper from being printed.The details of the above-described processing are described below withreference to FIGS. 6A and 6B.

The above-mentioned print settings can be set by a user's instructionissued, for example, in a host computer or a smart device, which is anapparatus that transmits a print job to the printing apparatus 100. Morespecifically, a display screen usable for the user to issue aninstruction about settings for the size of printing paper, the type ofprinting paper, and page margins provided on printing paper for printingis displayed by a host computer or a smart device. For example, the usercan specify print settings on the display screen after selecting printtarget data, thus issuing an instruction about the print settings forprinting of the print target data. Then, print setting informationindicating the print settings specified by the user is transmitted fromthe host computer or the smart device to the printing apparatus 100.Incidentally, a print job containing the print setting information andthe print target data may be transmitted to the printing apparatus 100,or the print setting information and the print target data may beseparately transmitted to the printing apparatus 100. Moreover, theprint setting information including the set paper size may betransmitted as a single file, such as a Digital Print Order Format(DPOF) file, to the printing apparatus 100 separately from a fileincluding the print target data.

As described with reference to FIG. 2, in the present exemplaryembodiment, in a case where the printing paper 104 is large, one edge ofthe printing paper 104 may not be detected by the paper sensor 118. Atthis time, the paper width is determined by calculation based on adistance between the middle position C and the position G. In this case,for example, depending on the characteristics of the printing paper 104,the printing paper 104 may be conveyed with the center line of theprinting paper 104 deviating from the middle position C. Therefore, in acase where one edge of the printing paper 104 is not detected, theabove-described predetermined range can be set to a relatively widerange, such as ±10 mm, instead of ±3 mm. In this case, for example, when“210 mm” is detected as the paper width, Double Postcard (paper width:200.0 mm), Photo 6P (paper width: 203.2 mm), A4 size (paper width: 201.0mm), and Letter (paper width: 215.9 mm) are specified as candidate papersizes.

Furthermore, in the above-described example, the CPU 201 specifies apaper size or paper sizes included in a predetermined range (forexample, ±3 mm) centering around the paper width detected by the papersensor 118. However, this is not a restrictive one. The CPU 201 canspecify a paper size or paper sizes included in a range from thedetected paper width to a width larger than the detected paper width bya predetermined width (for example, +3 mm), or, conversely, can specifya paper size or paper sizes included in a range from the detected paperwidth to a width smaller than the detected paper width by apredetermined width. Moreover, the predetermined range can be varieddepending on the type of printing paper (plain paper or glossy paper).For example, in a case where the printing paper is glossy paper, theintensity of reflected light is larger than in a case where the printingpaper is plain paper. At this time, the output level Vs acquired by thepaper sensor 118 in a position where the printing paper is not reallypresent may exceed the above-described threshold value Vth, thus causingan erroneous determination that the printing paper is present in thatposition. Therefore, for example, in a case where the printing paper isplain paper, a range of ±3 mm can be set, and in a case where theprinting paper is glossy paper, a range of ±6 mm can be set. Inaddition, the predetermined range can be set according to variousconditions, such as the characteristics of the paper sensor 118.

Furthermore, in the above-described example, the paper size isdetermined based on the paper size table illustrated in FIG. 4A.However, as another example, the paper size can be determined based on apaper size table illustrated in FIG. 4B.

The paper size table illustrated in FIG. 4B further includes paperinformation 304, which indicates paper sizes similar in paper width, inaddition to the paper size table illustrated in FIG. 4A. Morespecifically, paper size with mark “x” in the table is similar, in paperwidth, to paper size corresponding to the paper size with mark “x”. Forexample, the paper size table indicates that A4 size and Letter size aresimilar in paper width. Also, the paper size table indicates thatEnvelope You #6, Postcard, and Photo 4×6 are similar in paper width.

The CPU 201 can refer to the paper width 301 by reading out the papersize table illustrated in FIG. 4B from the program memory 203 to thedata memory 204. Then, when the paper width is detected by the papersensor 118, the CPU 201 specifies paper size corresponding to thedetected paper width. Further, if paper size similar in paper width tothe specified paper size is indicated in the paper size table, the CPU201 specifies a plurality of candidate paper sizes, including the papersize similar in paper width.

For example, when the paper width detected by the paper sensor 118 is90.00 mm, the CPU 201 uniquely specifies Photo L as paper size. On theother hand, when the paper width detected by the paper sensor 118 is99.00 mm, the CPU 201 specifies Postcard size, which is most similar tothe detected paper width, as paper size, and further specifies EnvelopeYou #6 and Photo 4×6, which are indicated in the paper information 304,in addition to Postcard.

In the above-described way, the CPU 201 determines the paper size ofprinting paper, including the paper length 302 in addition to the paperwidth 301, based on the paper size table illustrated in FIG. 4A or 4B.Then, the CPU 201 performs print processing according to the determinedpaper size.

Furthermore, the CPU 201 can set an optional paper size as paper sizefor printing, other than the paper sizes (typical sizes) indicated inthe paper size tables illustrated in FIGS. 4A and 4B. More specifically,the CPU 201 can set the paper width and the paper length as paper sizein units of millimeter (mm) and scales a print target image according tothe set paper width and paper length, thus printing an image with a sizecorresponding to the set paper size on the printing paper.

FIG. 5 is a flowchart illustrating an example of print controlprocessing performed by the CPU 201. A program corresponding to theprint control processing illustrated in the flowchart of FIG. 5 isstored in the program memory 203. The CPU 201 reads out the program tothe work memory 205 and executes the program on the work memory 205 toimplement processing in each step of the flowchart of FIG. 5.

In step S1000, the CPU 201 receives a print job from an externalapparatus via the interface control unit 207, and stores the print jobin the data memory 204. The print job includes data, such as an image,to be printed by the printing apparatus 100 (print target data) andprint setting information indicating print settings about a printingpaper type and a printing paper size to be used for printing the data.

After receiving the print job in step S1000, in step S1001, the CPU 201identifies the paper size set in the print settings, the type of anapparatus that has transmitted the print job, and the type of printtarget data included in the print job.

More specifically, in step S1001, the CPU 201 analyzes the print settinginformation included in the print job received in step S1000. Then, theCPU 201 identifies the set size of printing paper (set paper size),which is set for the print target data corresponding to the print job,in the print setting information. The set paper size in the printsetting information is set by the apparatus (a server, a host computer,a smart device, or the like) that has transmitted the print job, whichhas been received in step S1000. For example, when the user of theapparatus specifies a printing paper size on a screen of the apparatus,size information indicating the printing paper size is registered as theset paper size in the print setting information. Then, in step S1001,the CPU 201 receives a print job including the print setting informationand identifies the printing paper size, which has been set in such away.

The print setting information is included in the print job asinformation separate from the print target data in the print job. Thus,the information indicating the set paper size is also included in theprint job separately from the print target data. Furthermore, printsetting information including the set paper size can be transmitted tothe printing apparatus 100 as a single file, such as a Digital PrintOrder Format (DPOF) file. In other words, the print setting informationcan be transmitted to the printing apparatus 100 as a file separate fromthe print target data, such as a Joint Photographic Experts Group (JPEG)file.

However, setting information about the printing paper size may be or maynot be included in the print setting information depending on anapparatus that has transmitted the print job, which has been received instep S1000, or an application that has issued a printing instruction forthe print job. In step S1001, only in a case where the settinginformation about the printing paper size is included in the printsetting information, the CPU 201 identifies the size indicated by thesetting information as the above-mentioned set paper size.

Moreover, the CPU 201 can determine the type of the external apparatusbased on a protocol used for communication to receive the print job fromthe external apparatus or based on information, received from theexternal apparatus, indicating the type of the external apparatus. Also,the CPU 201 can determine the type of the print target data based on anextension of the file name of the print target data or based oninformation, received by the printing apparatus 100 from the apparatusthat has transmitted the print job, indicating the type of the printtarget data.

In step S1002, the CPU 201 determines whether to perform a fittingprint, in which printing is performed with the size of a print targetimage fitting to the size of printing paper stored in the printingapparatus 100, based on the type of the apparatus and the type of theprint target data, which have been identified in step S1001. Morespecifically, the CPU 201 determines whether the type of the apparatusand the type of the print target data identified in step S1001 arerespective predetermined types, and determines to perform the fittingprint if it is determined that those are the respective predeterminedtypes. For example, in a case where the printing apparatus 100 is ableto receive a print job from a server, a host computer, or the smartdevice 208, the CPU 201 determines that the smart device 208 is anapparatus of the predetermined type and determines to perform thefitting print. In addition, the CPU 201 checks the file format of printtarget data and determines whether the file format is a predeterminedfile format. For example, the CPU 201 can set, as the predeterminedtypes, an apparatus and a file format with which a photograph is likelyto be selected as a print target, thus enabling surely performing thefitting print for photographs.

Formats of files printable by the printing apparatus 100 include theJPEG format, a predetermined raster file format, and Portable DocumentFormat (PDF). The above-described predetermined type of the file formatis, for example, the JPEG format or the predetermined raster fileformat. In step S1002, if the file format identified in step S1001 isthe predetermined file format, the CPU 201 determines to perform thefitting print. On the other hand, if the file format identified in stepS1001 is PDF, the CPU 201 determines not to perform the fitting print.

While, in step S1002, the CPU 201 determines whether to perform thefitting print based on both the type of the apparatus and the type ofthe print target data, the CPU 201 can make the determination based oneither one of the types. For example, an image photographed by aphotographing apparatus may be stored in a memory in the JPEG fileformat. Therefore, in step S1002, the CPU 201 can make such adetermination as to perform the fitting print if the print target datais in the JPEG format.

Furthermore, various pieces of information can be used as a conditionidentified in step S1001 and used for the determination in step S1002.For example, the CPU 201 can determine to perform the fitting print ifthe print mode set for the printing apparatus 100 is a mode forperforming the fitting print. In addition, in a case where the printingapparatus 100 is equipped with a plurality of interfaces, the CPU 201can determine whether to perform the fitting print based on an interfacethat has been used for receiving the print job in step S1000. In a casewhere “equal size printing” is specified in the print settinginformation, the CPU 201 can determine not to perform the fitting print.

Moreover, the CPU 201 can determine to perform the fitting print in acase where, as another condition, the paper size is not specified in theprint setting information included in the print job received in stepS1000. The case where the paper size is not specified in the printsetting information may be, for example, a case where informationindicating the paper size is not included in the print settinginformation, or may be a case where information indicating the fittingprint is included in the print setting information as the paper sizeinformation.

In addition, the CPU 201 can determine whether to perform the fittingprint according to whether the user issues an instruction on the screento perform the fitting print based on a result of detection of the paperwidth by the paper sensor 118. For example, in a case where the CPU 201of the printing apparatus 100 displays on the operation panel 218 ascreen including a checkbox for the above-mentioned instruction and theuser checks the checkbox, the CPU 201 determines to perform the fittingprint. Moreover, the CPU 201 can determine to perform the fitting printin a case where the above-mentioned screen is displayed on the externalapparatus that has transmitted the print job and the user issues aninstruction for the fitting print via the external apparatus. In thiscase, the external apparatus transmits, to the printing apparatus 100,the print job with information indicating the fitting print includedtherein or added thereto. In step S1002, the CPU 201 of the printingapparatus 100 determines whether to perform the fitting print accordingto whether the above-mentioned information has been received by theexternal apparatus. The above-mentioned screen to be displayed on theoperation panel or the external apparatus is displayed in advance ofprinting, and the CPU 201 determines whether to perform the fittingprint by checking the content, which has been specified by the userbefore printing, in step S1002 at the time of printing. Moreover, theCPU 201 can determine to perform the fitting print in a case where theabove-mentioned screen is displayed at the time of printing and the userissues an instruction for the fitting print at the time of printing.

Furthermore, in a case where the above-mentioned instruction for thefitting print is not issued by the user, the CPU 203 can determine notto perform the fitting print irrespective of the type of the apparatusand the type of the print target data, which have been identified instep S1001. Thus, the CPU 201 can determine to perform the fitting printin a case where the above-mentioned instruction is issued by the userand the type of the apparatus and the type of the print target data arerespective predetermined types.

If, in step S1002, the CPU 201 determines to perform the fitting print(YES in step S1002), processing operations in steps S1003 to S1006 areexecuted. On the other hand, if the CPU 201 does not determine toperform the fitting print (NO in step S1002), the processing proceeds tostep S1007.

In step S1003, the CPU 201 drives the carriage 113 and the paper sensor118 via the motor control unit 209 and the sensor control unit 214 toperform the paper width detection described with reference to FIG. 2. Instep S1004, the CPU 201 acquires the paper width detected by the paperwidth detection in step S1003, and stores the paper width as paper widthinformation in the work memory 205.

In step S1005, the CPU 201 refers to the paper width information storedin step S1004 and the paper size table illustrated in FIG. 4A or 4B, andspecifies one or a plurality of paper sizes as candidate print mediumsizes from among typical paper sizes supported by the printing apparatus100. In this instance, as described above, a plurality of paper sizesmay be extracted as candidate print medium sizes depending on the paperwidth information stored in step S1004. The CPU 201 stores the extractedpaper sizes (group) as candidate paper size information in the workmemory 205.

In step S1006, the CPU 201 performs a fitting process to generate, onthe image memory 206, a print target image with a size fitting to thesize of the print medium conveyed in the printing apparatus 100. Thedetails of the fitting process are described below with reference toFIGS. 6A and 6B.

If the CPU 201 determines not to perform the fitting print (NO in stepS1002), the processing proceeds to step S1007. In step S1007, the CPU201 generates, on the image memory 206, a print target image accordingto the print settings specified by the print setting information. Forexample, in a case where a print target image is included in a print joband the print settings include “enlargement/reduction print” as aprinting method and “A4 size” as printing paper size, the CPU 201rasterizes image data and scales the rasterized image to a size fittingto A4 size. Also, in a case where the print settings include “equal sizeprint” as a printing method, the CPU 201 generates a print target imagewithout performing the above-mentioned scaling. In a case where theprint settings include “borderless printing”, the CPU 201 lays out aprint target image in a layout area to which the printing paper size setin the print settings is enlarged at a borderless enlargement ratio.

For example, in a case where the file format identified in step S1001 isPDF, in step S1002, the CPU 201 determines not to perform the fittingprint. In this case, the CPU 201 can set the paper size according to thepage size set in a PDF file.

In the case of PDF files, page size information can be written into eachpage file. For example, an appropriate page size is written in pages ofa PDF file. If the pages are fitted to a size other than the appropriatepage size, printing may be performed on printing paper different in sizefrom printing paper to be originally used for printing. Therefore, in acase where the file format identified in step S1001 is PDF, the CPU 201determines not to perform the fitting print and, in step S1007, sets thepage size set in the PDF file as printing paper size.

Also, in a case where the print target is a PDF file, the CPU 201 canperform the paper width detection via the paper sensor 118 in stepS1007. In this case, the CPU 201 compares the width of the page size setin the PDF file with the paper width detected by the paper sensor 118.Then, if a difference between the widths is smaller than a predeterminedwidth, the CPU 201 can perform printing with a size fitting to the pagesize, and, if the difference is equal to or larger than thepredetermined width, the CPU 201 can display, on the operation panel218, an error message usable for the user to confirm the printing papersize.

In step S1008, the CPU 201 outputs, to the head control unit 213, theprint target image generated on the image memory 206 in step S1006 orS1007. Then, the CPU 201 drives the print head 112 and the carriage 113to cause the print target image to be printed on the print medium.

Incidentally, when the CPU 201 generates a print target image in stepS1006 or S1007, if the print target data is image data, such as a JPEGimage file, the CPU 201 performs decompression processing to rasterizebitmap data on the image memory 206. If the print target data is vectordata, the CPU 201 performs rendering processing in the image memory 206to rasterize bitmap data on the image memory 206.

As described above, with the processing illustrated in the flowchart ofFIG. 5, the printing apparatus 100 prints an image with a sizecorresponding to the print settings or a size determined as a result ofdetection by the paper sensor 118.

FIG. 6A is a flowchart illustrating the details of the fitting processin step S1006 illustrated in FIG. 5.

In step S1200 in FIG. 6A, the CPU 201 determines whether the set papersize has been identified in step S1001 in FIG. 5. As described in stepS1001, setting information indicating the printing paper size may be ormay not be included in the print setting information depending on anapparatus that has transmitted the print job or an application that hasissued a printing instruction for the print job. In step S1200, the CPU201 determines whether the setting information indicating the printingpaper size is included in the print setting information for the printjob and the set paper size indicated by the setting information has beenidentified in step S1001.

If the CPU 201 determines that the set paper size has been identified instep S1001 (YES in step S1200), the processing proceeds to step S1201.If the CPU 201 determines that the set paper size has not beenidentified in step S1001 (NO in step S1200), the processing proceeds tostep S1202.

In step S1201, the CPU 201 determines whether the set paper sizeidentified in step S1001 is included in the candidate paper sizes(group) obtained in step S1005 based on the printing paper widthdetected by the paper sensor 118. If the CPU 201 determines that the setpaper size is not included in the candidate paper size group (NO in stepS1201), the processing proceeds to step S1202. On the other hand, if theCPU 201 determines that the set paper size is included in the candidatepaper size group (YES in step S1201), the processing proceeds to stepS1208. The details of step S1208 are described below.

In step S1202, the CPU 201 determines whether only one candidateprinting paper size has been obtained in step S1005. If the CPU 201determines that a plurality of candidate printing paper sizes has beenobtained (NO in step S1202), the processing proceeds to step S1203. Onthe other hand, if the CPU 201 determines that only one candidateprinting paper size has been obtained (YES in step S1202), the CPU 201sets the candidate printing paper size as a printing paper size (setpaper size) and the processing proceeds to step S1208. The details ofstep S1208 are described below.

In step S1203, the CPU 201 determines whether borderless printing is setas a margin setting for printing of the print job received in stepS1000. Various conditions can be used to determine whether borderlessprinting is set. For example, the CPU 201 can determine that borderlessprinting is set in a case where the print mode of the printing apparatus100 is a mode for performing borderless printing. In addition, the CPU201 can determine that borderless printing is set in a case whereborderless printing is specified in a margin setting, which is acquiredfrom the print setting information included in the print job receivedfrom the smart device 208 in step S1000 illustrated in FIG. 5.Furthermore, in step S1000 illustrated in FIG. 5, the CPU 201 canreceive, as well as the print job, information for identifying anapparatus that has transmitted the print job and an application that hasbeen used to issue a printing instruction. In this case, the CPU 201 candetermine whether borderless printing is set based on the type of theapparatus or application identified by the received information. Forexample, the CPU 201 can determine that borderless printing is set in acase where printing paper on which a photograph is often printed as aprint target image is set as one of the print settings, such as a casewhere the size of printing paper is “Photo L” or “Photo 2L” or a casewhere the type of printing paper is “glossy paper”.

If the CPU 201 determines that borderless printing is not set (NO instep S1203), the processing proceeds to step S1204. In step S1204, theCPU 201 acquires the smallest paper width from respective paper widthsof the candidate printing paper sizes included in the candidate papersize group, and stores, in a predetermined area of the work memory 205,the smallest paper width as the width of a layout region on which aprint target image is to be rasterized (a layout width). For example, ina case where the candidate paper size group includes A4 size (paperwidth: 210.0 mm, paper length: 297.0 mm) and Letter size (paper width:215.9 mm, paper length: 279.4 mm), in step S1204, the CPU 201 acquiresthe paper width “210.0 mm” of A4 size. In step S1205, the CPU 201acquires the smallest paper length from respective paper lengths of thecandidate printing paper sizes included in the candidate paper sizegroup, and stores, in a predetermined area of the work memory 205, thesmallest paper length as a layout length. In the above-describedexample, the CPU 201 acquires the paper length “279.4 mm” of Lettersize.

On the other hand, if the CPU 201 determines that borderless printing isset (YES in step S1203), the processing proceeds to step S1206. In stepS1206, the CPU 201 acquires the largest paper width from the candidatepaper size group, and stores, in a predetermined area of the work memory205, the largest paper width as a layout width. In a case where thecandidate paper size group includes A4 size and Letter size, the CPU 201acquires the paper width “215.9 mm” of Letter size. In step S1207, theCPU 201 acquires the largest paper length from the candidate paper sizegroup, and stores, in a predetermined area of the work memory 205, thelargest paper length as the length of a layout region on which a printtarget image is to be rasterized (a layout length). In theabove-described example, the CPU 201 acquires the paper length “297.0mm” of A4 size.

In the above-described processing in steps S1206 and S1207, the CPU 201acquires the largest width and the largest length from among all of thecandidate printing paper sizes included in the candidate paper sizegroup and determines the largest width and the largest length as alayout width and a layout length. However, depending on theconfiguration of the platen 111 of the printing apparatus 100 or thetype and intended use of printing paper, the candidate paper size groupmay include a paper size or paper sizes that do not support borderlessprinting. In such a case, in the layout determination process forborderless printing performed in steps S1206 and S1207, the CPU 201 canacquire the largest width and the largest length from a limited range ofpaper sizes that support borderless printing among the candidate papersize group.

After the CPU 201 determines the largest width and the largest length inthe process performed in steps S1203 to S1207, the processing proceedsto step S1209.

In step S1209, the CPU 201 enlarges or reduces a print target image,which corresponds to the print job received in step S1000 illustrated inFIG. 5, in such a way as to fit the layout width and the layout lengthstored in the work memory 205, and rasterizes the enlarged or reducedprint target image on the image memory 206 of the data memory 204.

Incidentally, in step S1209, in a case where a print target image isincluded in the print job, the CPU 201 rasterizes the print target imageon the image memory 206. In a case where text data or vector data isincluded in the print job, or in a case where a structured document,such as a HyperText Markup Language (HTML) document, is targeted forprinting, the CPU 201 performs rendering on such data to rasterize aprint target image on the image memory 206. Moreover, in a case where aUniform Resource Locator (URL) or file path information for identifyinga storage location of print target data is included in the print job,the CPU 201 acquires the print target data from an external server or aninternal or external memory according to such information. Then, the CPU201 rasterizes a print target image on the image memory 206 based on theprint target data.

If the CPU 201 determines that the set paper size is included in thecandidate paper sizes (group) (YES in step S1201) or if the CPU 201determines that only one candidate paper size is present (YES in stepS1202), the processing proceeds to step S1208.

In step S1208, the CPU 201 sets the width of a layout region on which aprint image is to be rasterized (a layout width) and the length of thelayout region (a layout length) according to the width, length, andmargin setting of the set paper size, and stores the layout width andthe layout length in a predetermined area of the work memory 205. Then,the processing proceeds to step S1209.

In step S1209, as described above, the CPU 201 enlarges or reduces aprint target image in such a way as to fit the width and length of thelayout region determined in step S1208, and rasterizes the enlarged orreduced print target image on the image memory 206.

As described above, if, in step S1201, the CPU 201 determines that theset paper size is included in the candidate paper sizes (group), then instep S1208, the CPU 201 determines the width and length of the layoutregion, on which a print target image is to be rasterized, according tothe set paper size.

Accordingly, for example, in a case where the user specifies a desiredsize as a printing paper size via an apparatus that transmits a printjob, the CPU 201 can rasterize an image onto a layout region with a sizecorresponding to the specified size to print the rasterized image.

In addition, in a case where the set paper size is not included in thecandidate paper sizes (group) or a plurality of candidate paper sizes ispresent, then in steps S1203 to S1207, the CPU 201 determines the widthand length of the layout region according to the presence or absence ofborderless printing setting.

In the process performed in steps S1204 and S1205, if a plurality ofcandidate printing paper sizes is present and borderless printing is notspecified (NO in step S1203), the CPU 201 acquires the smallest paperwidth and the smallest paper length from among respective paper widthsand paper lengths of the plurality of candidate printing paper sizes.Then, in step S1209, the CPU 201 scales a print target image in such away as to fit the size of a rasterization region obtained by excludingrespective margins from the smallest paper width and the smallest paperlength. Then, since a print target image the width and length of whichare smaller than the paper width and paper length of printing paper isgenerated regardless of whichever of a plurality of candidate papersizes the printing paper used for the printing apparatus 100 is, theentire print target image can be printed on the printing paper.

Also, in the process performed in steps S1206 and S1207, if a pluralityof candidate printing paper sizes is present and borderless printing isspecified (YES in step S1203), the CPU 201 acquires the largest paperwidth and the largest paper length from among respective paper widthsand paper lengths of the plurality of candidate printing paper sizes.Then, in step S1209, the CPU 201 scales a print target image in such away as to fit the size of a rasterization region obtained by enlargingthe largest paper width and the largest paper length at a borderlessenlargement ratio. Then, since a print target image the width and lengthof which are larger than the paper width and paper length of printingpaper is generated regardless of whichever of a plurality of candidatepaper sizes the printing paper used for the printing apparatus 100 is,borderless printing in which no margins are present on printing papercan be performed as borderless printing setting.

As described above, according to the processing illustrated in FIG. 6A,in a case where the set paper size specified by the user to be used forprinting is greatly different from the size of printing paper actuallyused for printing, the width and length of the layout region aredetermined based on the candidate paper size group. Thus, for example,in a case where the user specifies, as the set paper size, a sizegreatly different from the size of printing paper actually used forprinting or in a case where printing paper greatly different in sizefrom the set paper size is stored in the printing apparatus 100, theprocess in steps S1203 to S1207 is performed. Accordingly, images ofappropriate sizes corresponding to the size of printing paper actuallyused for printing and the specification of borderless printing can beprinted on the printing paper.

Next, another example of the fitting process in step S1006 illustratedin FIG. 5 is described with reference to FIG. 6B.

In the process illustrated in FIG. 6A, in a case where the set papersize is identified and the set paper size is not included in thecandidate paper sizes (group), the CPU 201 determines the size of thelayout region based on the candidate paper sizes (group). On the otherhand, in the process illustrated in FIG. 6B, in a case where the setpaper size is identified and the set paper size is not included in thecandidate paper sizes (group), the CPU 201 issues an error notificationto the user, thus preventing printing from being performed. Steps S1200to S1202, S1208, and S1209 in FIG. 6B are similar to those described inthe description of FIG. 6A, and the detailed description thereof is,therefore, not repeated.

In step S1200, the CPU 201 determines whether the set paper size hasbeen identified in step S1001. If the CPU 201 determines that the setpaper size has been identified in step S1001 (YES in step S1200), theprocessing proceeds to step S1201. If the CPU 201 determines that theset paper size has not been identified (NO in step S1200), theprocessing proceeds to step S1202.

In step S1201, the CPU 201 determines whether the set paper size isincluded in the candidate paper sizes (group). If the CPU 201 determinesthat the set paper size is included in the candidate paper size group(YES in step S1201), the processing proceeds to step S1208. In stepS1208, the CPU 201 sets a layout width and a layout length according tothe set paper size. Then, in step S1209, the CPU 201 rasterizes a printtarget image on a layout region with the layout width and the layoutlength set in step S1208. Then, the processing proceeds to step S1008for performing printing illustrated in FIG. 5.

On the other hand, if the CPU 201 determines that the set paper size isnot included in the candidate paper size group (NO in step S1201), theprocessing proceeds to step S1210. At this time, printing paper used forprinting has been conveyed up to the position below the paper sensor 118illustrated in FIG. 1 to detect the width of the printing paper via thepaper sensor 118 in step S1003 illustrated in FIG. 5. In step S1210, tocancel the printing (printing based on the print job received in stepS1000 in FIG. 5), the CPU 201 controls the conveyance motor 210 todischarge the printing paper to the discharge tray 117 withoutperforming printing via the print head 112.

In step S1211, the CPU 201 issues, to the user, an error notificationindicating that the printing has been canceled. For example, the CPU 201controls the panel control unit 217 to provide, on the operation panel218, a display indicating that the set paper size is different from thesize of printing paper conveyed in the printing apparatus 100. At thistime, the CPU 201 can display both or one of the set paper size and thecandidate paper sizes (group) to allow the user to correct both or oneof the set paper size and the size of printing paper used for printingby the printing apparatus 100 and to issue an instruction for printingagain. Furthermore, the method for issuing the error notification is notlimited to displaying, but may be outputting of warning sound or aspeech indicating the content of warning.

After the error notification is completed in step S1211, the processingends. At this time, since the processing does not proceed to step S1008illustrated in FIG. 5, the printing process is canceled.

If the CPU 201 determines that the set paper size has not beenidentified in step S1001 illustrated in FIG. 5 (NO in step S1200), theprocessing proceeds to step S1202. In step S1202, the CPU 201 determineswhether only one candidate paper size is present.

If the CPU 201 determines that only one candidate paper size is present(YES in step S1202), the processing proceeds to step S1213. On the otherhand, if the CPU 201 determines that a plurality of candidate papersizes is present (NO in step S1202), the processing proceeds to stepS1212.

In step S1212, the CPU 201 narrows down the plurality of candidate papersizes to a candidate paper size used for determining the size of alayout region on which a print target image is to be rasterized. Variousconditions can be used to narrow down the plurality of candidate papersizes. The usable conditions include, for example, the type of printingpaper or destination information of the printing apparatus 100. The typeof printing paper is specified, for example, by an instruction from theuser in an apparatus that transmits a print job. Type informationindicating the specified type is included in the print settinginformation. In step S1001, the CPU 201 acquires the type informationand identifies the type of printing paper. “Envelope”, “Postcard”, orthe like is specified as the type of printing paper, and printprocessing is performed according to the specified type. For example, ina case where the plurality of candidate paper sizes is “Postcard” and“Photo 4×6” and the type of printing paper is “Postcard”, the CPU 201narrows down the plurality of candidate paper sizes to a candidate papersize “Postcard”, since “Postcard” is a more appropriate paper size than“Photo 4×6”.

The “destination information” indicates a country or region to which theprinting apparatus 100 is shipped or in which the printing apparatus 100is sold. The destination information is stored in the program memory203. The CPU 201 can refer to the destination information todiscriminate a country or region in which the printing apparatus 100 isused. For example, in a case where the candidate paper sizes are “A4”and “Letter” and the destination information is “Japan”, since A4 sizeis more often used in Japan than Letter size, the CPU 201 can narrowdown to “A4”. The destination information is not limited to theabove-mentioned information indicating a country or region in which theprinting apparatus 100 is sold, but may be, for example, information forlanguage setting. The printing apparatus 100 has settings for languagesto be used for displaying notifications and guidance to users. The CPU201 can identify a country or region in which the printing apparatus 100is used based on the language setting information.

Furthermore, various conditions, such as the type of printing paper andthe destination information, can be combined to be used for narrowingdown. For example, in a case where candidate paper sizes cannot benarrowed down based on the type of printing paper, the CPU 201 canfurther perform narrowing down based on the destination information. Forexample, in a case where the candidate paper sizes are “Photo 4×6”,“Envelope Chou #3”, and “Photo 2L” and the type of printing paper is“others” other than “Envelope” and “Postcard”, “Envelope Chou #3”, whichcorresponds to “Envelope”, is excluded, but “Photo 4×6” and “Photo 2L”remain as candidate paper sizes. Then, the CPU 201 refers to thedestination information. When the destination information indicates “theUnited States”, since “Photo 4×6” is more often used in the UnitedStates than “Photo 2L”, the CPU 201 can narrow down to “Photo 4×6”.

After narrowing down of the plurality of candidate paper sizes in stepS1212 is completed, the processing proceeds to step S1213.

In step S1213, the CPU 201 sets the layout width and the layout lengthof a layout region, on which a print target image is to be rasterized,according to the candidate paper size. Then, in step S1209, the CPU 201rasterizes the print target image onto the layout region, the size ofwhich has been determined in step S1213.

As described above, according to the processing illustrated in FIG. 6B,for example, in a case where the user specifies a desired printing papersize via an apparatus that transmits a print job, in step S1201, the CPU201 determines whether the specified size corresponds to the size ofprinting paper actually used for printing. Then, if it is determinedthat the size specified by the user corresponds to the size of printingpaper actually used for printing (YES in step S1201), the CPU 201 cancause an image corresponding to the specified size to be printed on theprinting paper.

On the other hand, if it is determined that the size specified by theuser does not correspond to the size of printing paper actually used forprinting (NO in step S1201), the CPU 201 performs the process in stepsS1210 and S1211 to cancel the printing. Therefore, in a case where theuser has erroneously specified a size that is greatly different from thesize of printing paper actually used for printing or in a case whereprinting paper the size of which is greatly different from the sizespecified by the user has been conveyed, the CPU 201 can prevent theprinting from being performed.

The method for limiting printing is not limited to the method forcanceling printing, but may be a method for issuing an errornotification in step S1211 without discharging paper and for performingprinting when the user issues an instruction for performing printing inresponse to the error notification. In this case, if the user issues aninstruction for canceling printing in response to the errornotification, the CPU 201 discharges printing paper in step S1210 tocancel the printing.

Furthermore, if the set paper size is not identified and a plurality ofcandidate paper sizes is present (NO in step S1200 and NO in stepS1202), the CPU 201 narrows down the candidate paper sizes with theabove-described various conditions. Therefore, in a case where the userdoes not specify the size of printing paper or in a case where anapplication that does not specify the size of printing paper issues aprint job, an image with an appropriate size corresponding to the sizeof printing paper actually used for printing can be printed on theprinting paper.

In addition, the CPU 201 can determine whether to cancel printing notonly based on an instruction from the user but also according to variousconditions. The various conditions can include the type of printingpaper that is set in the print setting information. For example, in acase where the type of printing paper is photo paper (glossy paper orcoated paper), the CPU 201 can perform a cancel operation. In a casewhere the type of printing paper is plain paper, the CPU 201 can performprinting according to the set paper size or the candidate paper sizewithout performing the cancel operation. Accordingly, if printing islikely to be performed on relatively costly printing paper, such asglossy paper, the CPU 201 can prevent an image with a size inappropriatefor the size of that paper from being printed. Moreover, for example,before the user causes a photographic image to be printed on printingpaper of Photo L size, the user may want to confirm a printed result bycausing printing to be performed on plain paper of A4 size whilespecifying “Photo L” as the set paper size. With the above-describedconfiguration employed, even if the set paper size is different from thecandidate paper size as in the above case, printing can be performed ifthe paper type is plain paper, so that the printing intended by the usercan be implemented.

FIGS. 7A, 7B, 7C, 7D, 7E, and 7F illustrate various relationshipsbetween the size of a layout region and the size of printing paper whenprinting is performed according to the process illustrated in FIG. 6A or6B. In FIGS. 7A to 7F, a case where the candidate paper size is “A4” or“Letter” is described. As mentioned above, A4 size and Letter size havesuch a relationship that Letter size is slightly larger in paper widthand A4 size is slightly larger in paper length.

For example, in a case where Letter size is set as the set paper size,when printing paper actually used for printing is Letter size or A4size, a hatched portion illustrated in FIG. 7A or 7B, respectively, isset as a layout size. Also, for example, in a case where A4 size is setas the set paper size, when printing paper actually used for printing isLetter size or A4 size, a hatched region illustrated in FIG. 7C or 7D,respectively, is set as a layout size.

According to the processing illustrated in FIG. 6B, in a case where theset paper size is neither A4 size nor Letter size, printing is canceled.Therefore, for example, in a case where the user erroneously specifiesPhoto L size, which is greatly different from A4 size and Letter size,printing is canceled. Accordingly, it is possible to prevent printingfrom being performed with an image rasterized to a layout regioncorresponding to Photo L size, which is small compared to printing paperactually used for printing. Also, it is possible to prevent printingfrom being performed on printing paper, such as A4 size or Letter size,that is large compared to an image corresponding to Photo L size inspite of the user specifying the set paper size “Photo L” in a print jobin which printing is to be performed originally on printing paper ofPhoto L size.

Furthermore, according to the processing illustrated in FIG. 6A, in acase where a plurality of candidate paper sizes is present andborderless printing is specified, even if printing paper used forprinting is either one of the plurality of candidate paper sizes, aprint target image the width and length of which are larger than thepaper width and paper length of the printing paper is generated.Accordingly, printing can be performed without any margins in theprinting paper as in the specified borderless printing.

FIGS. 7E and 7F each illustrate a relationship between a layout regionand printing paper in a case where the candidate paper sizes are A4 sizeand Letter size and the settings for A4 size and borderless printing arespecified. FIGS. 7E and 7F illustrate cases where printing paper ofLetter size and printing paper of A4 size are used for printing,respectively. a hatched region illustrated in each of FIGS. 7E and 7F isset as a layout region.

As illustrated in FIGS. 7E and 7F, even if printing paper actually usedfor printing is either A4 size or Letter size, a region the width andlength of which are larger than those of the printing paper is set asthe layout region. Thus, printing can be performed without any marginsin the printing paper as in the specified borderless printing.

In the above-described exemplary embodiment, an example has beendescribed in which when receiving a print job from an externalapparatus, the printing apparatus 100 determines the size of printingpaper and performs printing according to the determined paper size.However, this example is not a restrictive one. The present exemplaryembodiment can apply to a case where the printing apparatus 100determines paper size in a copy function in which an image read by thescanner 220 included in the printing apparatus 100 is printed onprinting paper.

Furthermore, in the above-described exemplary embodiment, an example hasbeen described in which a print job is received from the smart device208 connected via an interface. However, a print job can be receivedfrom a remote location connected via a telephone line or a network line.Although an example has been described in which an apparatus that issuesa print job is the smart device 208, the apparatus may be, instead ofthe smart device 208, a mobile phone, a host computer, or a digitaltelevision set. Moreover, the printing apparatus 100 may receive a printjob not only directly from an apparatus operable by the user but alsovia an intermediate apparatus, such as a print server or a cloudservice.

FIG. 8 is a flowchart illustrating an example of print controlprocessing for a copy function. The processing illustrated in theflowchart of FIG. 8 is executed by the CPU 201 similar to the processingillustrated in FIG. 5. Also, the processing illustrated in the flowchartof FIG. 8 is executed when the user selects the copy function via theoperation panel 218 of the printing apparatus 100 and an instruction forperforming the copy function is input to the CPU 201.

In step S2000, the CPU 201 causes the panel control unit 217 to display,on a display panel of the operation panel 218, a setting screen used forthe user to specify a copy setting and a copy start instruction in thecopy function. The contents settable via the copy setting screen includesettings in the copy function, such as paper size of printing paper usedfor printing, the number of copies to be printed, a margin setting, anda print intensity. The margin setting includes setting of “borderlesscopy” indicating whether to provide margins (borders) in printing paperto be used for copying, and setting of the widths of margins whenborderless copy is not specified. Copy setting information indicatingdefault copy settings is stored in the program memory 203, and the CPU201 reads out the copy setting information to the data memory 204 andcauses the default copy settings to be displayed on the copy settingscreen. The user can change the default settings to specify the copysetting.

The above-mentioned copy setting includes a scaling setting aboutscaling (enlargement or reduction) of a scanned image read by thescanner 220. For example, in a case where “equal size setting” isspecified, the scanned image is printed without being scaled. Also, in acase where the user specifies magnification, the scanned image is scaledat the specified magnification. Moreover, in a case where “auto scaling”is specified, scaling (fitting process) is performed in such a way as tofit paper stored in the printing apparatus 100.

In step S2001, the CPU 201 determines whether the user has issued aninstruction for the copy setting. If the CPU 201 determines that theuser has issued an instruction for the copy setting (YES in step S2001),the processing proceeds to step S2002. If the CPU 201 determines thatthe user has not issued an instruction for the copy setting (NO in stepS2001), the processing proceeds to step S2003.

In step S2002, the CPU 201 acquires, via the panel control unit 217, thecopy setting information, which indicates the copy setting specified bythe user via the operation panel 218. Thus, in step S2002, the CPU 201rewrites the copy setting information stored in the data memory 204 withthe copy setting information specified by the user. In step S2003, theCPU 201 determines whether the copy start instruction has been issued bythe user. If the CPU 201 determines that the copy start instruction hasbeen issued (YES in step S2003), the processing proceeds to step S2004.If the CPU 201 determines that the copy start instruction has not beenissued (NO in step S2003), the processing returns to step S2001. In stepS2004, the CPU 201 causes the scanner 220 via the scanner control unit219 to read a document.

In step S2005, the CPU 201 determines whether “auto scaling” isspecified in the copy setting information stored in the data memory 204.If the CPU 201 determines that “auto scaling” is not specified (NO instep S2005), then in step S2006, the CPU 201 generates a print targetimage on the image memory 206 according to the scaling setting in thecopy setting information.

On the other hand, if the CPU 201 determines that “auto scaling” isspecified (YES in step S2005), the processing in steps S2007 to S2010 isexecuted. In steps S2007 to S2010, the CPU 201 determines the size ofprinting paper conveyed in the printing apparatus 100 and then scalesthe scanned image, obtained by reading in step S2004, according to thedetermined paper size. The processing in steps S2007 to S2010 is similarto the above-described processing in steps S1003 to S1006 with referenceto FIG. 5, and the detailed description thereof is, therefore, notrepeated.

In step S2011, the CPU 201 outputs, to the head control unit 213, theprint target image generated on the image memory 206 in steps S2006 orS2010. Then, the CPU 201 drives the print head 112 and the carriage 113to print the print target image on the printing paper.

As described above, in the processing illustrated in FIG. 8, in a casewhere the scaling setting in the copy setting information is “autoscaling”, an image with a size corresponding to the size of printingpaper conveyed in the printing apparatus 100, determined via the papersensor 118, can be printed on the printing paper.

According to the above-described exemplary embodiment, for example, in acase where the user specifies a desired printing paper size via anapparatus that transmits a print job, it is determined whether thespecified size corresponds to the size of printing paper actually usedfor printing. If it is determined that the size specified by the usercorresponds to the size of printing paper actually used for printing, animage with a size corresponding to the specified size can be printed onthe printing paper.

On the other hand, if it is determined that the size specified by theuser does not correspond to the size of printing paper actually used forprinting, an image with a size corresponding to the candidate paper sizecan be printed on the printing paper (FIG. 6A) or the printing iscanceled (FIG. 6B).

Accordingly, for example, if the user erroneously specifies a size thatis greatly different from the size of printing paper used for printing,or if printing paper with a size that is greatly different from the sizespecified by the user is conveyed, the printing apparatus 100 canperform appropriate processing. More specifically, in such a case, theprinting apparatus 100 can prevent an image with a size that is greatlydifferent from the size of printing paper from being printed.

Furthermore, in a case where the set paper size is not identified,printing is performed according to the candidate print medium sizedetermined based on the paper width detected by the paper sensor 118.Therefore, in a case where the user does not specify the size ofprinting paper or in a case where an application that does not specifythe size of printing paper issues a print job, an image with anappropriate size corresponding to the size of printing paper actuallyused for printing can be printed on the printing paper.

The “set paper size” described in the above-described exemplaryembodiment is not limited to the one specified by the user via anapparatus that transmits a print job. For example, the set paper sizecan be set to the printing apparatus 100 by the user via the operationpanel 218 of the printing apparatus 100. Moreover, the “set paper size”is not limited to the one specified by the user, but may be the oneautomatically set according to various conditions, such as the type ofan apparatus that transmits a print job, an application, and a printmode in the printing apparatus 100.

Furthermore, in the above-described exemplary embodiment, an example hasbeen described in which the size of printing paper is determined basedon a result of detection by the paper sensor 118 when printing isperformed based on a print job received from an external apparatuslocated outside the printing apparatus 100 or when the copy function isexecuted in the printing apparatus 100. However, this is not arestrictive one. For example, when an image stored in the memory card223 attached to the memory card slot 222 is printed according to theprint settings set by the user via the operation panel 218, theabove-described processing for determining the size of printing papercan be executed. For example, in a case where any paper size is notspecified in the print setting information indicating the print settingsspecified by the user, the above-described processing for determiningthe size of printing paper can be executed. The case where any papersize is not specified in the print setting information includes a casewhere no paper size is included in the print setting information and acase where an instruction for executing processing for setting the papersize according to a result of detection by the paper sensor 118 isincluded in the print setting information.

Furthermore, the present exemplary embodiment can apply to a case where,when printing is performed according to the print settings specified bythe user via the printing apparatus 100, an image stored in an internalmemory included in the printing apparatus 100 instead of an externalmemory, such as the memory card 223, is printed. Moreover, the presentexemplary embodiment can apply to a case where an image stored in anexternal apparatus, such as a server, connected to the printingapparatus 100 via a network is printed according to the print settingsspecified by the user via the operation panel 218 of the printingapparatus 100.

In addition, in the above-described exemplary embodiment, a case hasbeen described in which the paper sensor 118 of the printing apparatus100 detects the width of printing paper. This is not a restrictive one.The present exemplary embodiment can apply to a case where the length ofprinting paper is detected by a sensor or a case where both the widthand length of printing paper are detected. In either detection method,in a case where a plurality of candidate paper sizes is present as thesize of printing paper used in the printing apparatus 100, anappropriate paper size can be determined according to the processingdescribed in the present exemplary embodiment.

Furthermore, the present exemplary embodiment is not limited to a casewhere the size of printing paper is automatically determined by asensor. For example, the user can specify, via an operation panel of theprinting apparatus, the size of printing paper stored in a cassette inthe printing apparatus or the size of printing paper inserted by theuser into a paper feed port of the printing apparatus. Then, the sizespecified by the user can be applied as the size of printing paperautomatically determined by the sensor in the above-described exemplaryembodiment, so that the processing according to the above-describedexemplary embodiment can be executed.

In addition, the timing at which the user specifies the size of printingpaper may be arbitrary. For example, a sensor for detecting opening andclosing of a cassette in the printing apparatus or a sensor fordetecting whether printing paper is present on the paper feed port ismounted in the printing apparatus. Then, when the sensor detects thatthe cassette is opened and then closed or that printing paper isinserted into the paper feed port, a screen usable for the user tospecify the size or type of the printing paper is displayed on theoperation panel of the printing apparatus. Then, the size specified bythe user via the screen can be used as the size determined by the sensorin the above-described exemplary embodiment.

Furthermore, in the above-described exemplary embodiment, a case hasbeen described in which the CPU 201 included in the printing apparatus100 executes, as an information processing apparatus, the processing fordetermining the paper size illustrated in FIGS. 6A and 6B. However, thisis not a restrictive one. For example, the present exemplary embodimentcan apply to a case where an information processing apparatus, such as ahost computer or a server, connected to the printing apparatus 100 andconfigured to cause the printing apparatus to perform printing serves asa print control apparatus according to the present exemplary embodimentto execute the processing described in the present exemplary embodiment.

More specifically, a host computer, a server, or a smart device executesthe processing in steps S1001 to S1007 illustrated in FIG. 5 whentransmitting a print job to the printing apparatus 100. Thus, the hostcomputer, the server, or the smart device, when transmitting a print jobto the printing apparatus 100, acquires information about the paperwidth of printing paper detected by the paper sensor 118 of the printingapparatus 100. Then, the host computer, the server, or the smart devicespecifies a candidate printing paper size according to the paper widthindicated by the acquired information, and determines a layout regionbased on the specified candidate printing paper size and the set papersize. Then, the host computer, the server, or the smart devicerasterizes a print target image onto the layout region on a memoryincluded in the host computer, the server, or the smart device, andtransmits the rasterized image as a print job to the printing apparatus100, thus causing the printing apparatus 100 to perform printing. Morespecifically, under the control of the CPU 201 of the printing apparatus100, a printing mechanism included in the printing apparatus 100 printsthe image received from the host computer, the server, or the smartdevice on printing paper.

In the above-described configuration, when printing is canceled in stepsS1210 and S1211 illustrated in FIG. 6B, the host computer, the server,or the smart device issues an error notification. More specifically, thehost computer, the server, or the smart device provides a displayindicating that printing has been canceled or a display for allowing theuser to confirm both or one of the size of printing paper set in theprinting apparatus 100 and the set paper size. In a case where the hostcomputer issues an error notification, such a display is performed on adisplay device included in the host computer or on an external displaydevice connected to the host computer. In a case where the server issuesan error notification, the server notifies a client apparatus that hastransmitted a print job to the server of the content of the errornotification, so that an error display is performed on an internaldisplay device or an external display device of the client apparatus.

Furthermore, as another example of a case where the processing in thepresent exemplary embodiment is executed in the host computer, theserver, or the smart device, such an apparatus can perform up to thedetermination of the size of a layout region in steps S1205, S1207,S1208, and S1213 illustrated in FIGS. 6A and 6B. In this case, scalingof a print target image in step S1209 is performed by the CPU 201 of theprinting apparatus 100. Sharing of processing between the printingapparatus 100 and the host computer, the server, or the smart device canbe configured in various other manners in the present exemplaryembodiment.

In addition, in the above-described exemplary embodiment, a case hasbeen described in which an example of a print medium on which an imageis to be printed by the printing apparatus is printing paper. However,this is not a restrictive one. The print medium may be an overheadprojection (OHP) sheet. Moreover, the print medium is not limited to arectangular print medium, such as the above-mentioned printing paper,but may be a disc-shaped recording medium, such as a compact disc (CD)or a digital versatile disc (DVD).

Embodiments can also be realized by a computer of a system or apparatusthat reads out and executes computer executable instructions recorded ona storage medium (e.g., computer-readable storage medium) to perform thefunctions of one or more of the above-described embodiment(s) of thepresent invention, and by a method performed by the computer of thesystem or apparatus by, for example, reading out and executing thecomputer executable instructions from the storage medium to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more of a central processing unit (CPU),micro processing unit (MPU), or other circuitry, and may include anetwork of separate computers or separate computer processors. Thecomputer executable instructions may be provided to the computer, forexample, from a network or the storage medium. The storage medium mayinclude, for example, one or more of a hard disk, a random-access memory(RAM), a read only memory (ROM), a storage of distributed computingsystems, an optical disk (such as a compact disc (CD), digital versatiledisc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memorycard, and the like.

Furthermore, computer executable instructions for implementing thefunctions of the above-described exemplary embodiment can be executed bya single computer (CPU or MPU) or can be cooperatively executed by aplurality of computers. Moreover, not only the computer executableinstructions can be executed by a computer or computers, but alsohardware, such as a circuitry, for implementing the functions of thecomputer executable instructions can be provided. In addition, parts ofthe computer executable instructions can be implemented by hardware andother parts thereof can be executed by a computer or computers.

While the present disclosure has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures and function.

What is claimed is:
 1. A printing apparatus comprising: a display unit;and a printing unit configured to print an image based on print targetdata received from an external device, wherein the display unit displaysa screen for a user to designate a size of a print medium, if a sensordetects opening or closing of a cassette for containing the printmedium; and, if a print medium size is not set at the external device bya user as a print setting for the print target data, the printing unitprints an image having a size corresponding to a designated size whichis designated by the user on the screen based on the print target data,and, if the print medium size is set at the external device by a user asthe print setting and the print medium size does not correspond to thedesignated size, the printing unit does not print an image on the printmedium based on the print target data, and, if the print medium size isset at the external device by a user as the print setting and the printmedium size corresponds to the designated size, the printing unit printsan image having a size corresponding to the print medium size on theprint medium, based on the print target data.